package com.Spring.student.register;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Register {

    public static void main(String[] args) {

        // 加载 spring配置文件
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("applicationContext.xml");
        // 获取 bean 的实例
        User user = (User) context.getBean("user");
        System.out.println(user);

        ((AbstractApplicationContext)context).close();

    }

}
